<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="/js/axios.min.js"></script>
<script src="/js/util.js"></script>
<script>
    var id;
    window.onload =function (){
         id = getQuery("id");

        axios.get("/user/findById",{
            params:{
                id,
            }
        }).then(resp=>{
            var info = resp.data;
            $("username").innerHTML=info.username;
            $("gender").innerHTML=info.gender;
            $("salary").value=info.salary;
            $("birthday").innerHTML=info.birthday;
            });
    }

    function update(){
        axios.get("/user/update",{
            params:{
                id,
                salary:$("salary").value
            }
        }).then(resp=>{
            if (resp.data=="ok"){
              location.href="/index.html";
            }
        })
    }

</script>
<body>
用户名：<span id="username"></span><br>
性别：<span id="gender"></span><br>
工资：<input type="text" id="salary"><br>
生日：<span type="text" id="birthday"></span><br>
<input type="button" value="修改" onclick="update()">
</body>
</html>